﻿
namespace Pibby.Core.Views
{
	using System;
	using Pibby.Core.IO;
	using Pibby.Core.ViewModels;

	public interface IPodcatcherView
	{
		event EventHandler Initialising;
		event EventHandler InitialiseComplete;

		event EventHandler ClosingView;
		
		void SettingsLoaded(IUserSettings settings);
		void SettingsChanged(IUserSettings settings);

		int Width { get; }
		int Height { get; }
		int Top { get; }
		int Left { get; }

		int SplitterDistance { get; }
		int CurrentView { get; }

		//SubView SubView { get; }

		#region Persistence events

		//event EventHandler<SubViewEventArgs> SubViewChanged;

		#endregion

		#region Subscription management events

		event EventHandler<NewPodcastEventArgs> AddPodcast;

		event EventHandler NewEpisodesSelected;
		event EventHandler DownloadsSelected;

		event EventHandler SubscriptionsSelected;

		event EventHandler<PodcastEventArgs> PodcastSelected;
		event EventHandler<SearchEventArgs> SearchPodcasts;
		event EventHandler<PodcastSearchEventArgs> SearchPodcast; // search within podcast episodes

		void ShowPodcastInfo(Podcast podcast, EpisodeCollection episodes);

		void LoadSubscriptions(PodcastCollection collection);
		
		void ShowSubscriptionList(PodcastCollection collection);

		void LoadSearchResults(PodcastCollection collection);

		void LoadNewEpisodes(EpisodeCollection collection);

		void LoadDownloadedEpisodes(EpisodeCollection collection);

		void LoadPodcastEpisodes(EpisodeCollection collection);
		
		#endregion Subscription management events

		event EventHandler CheckForEpisodes;

		event EventHandler<EpisodeEventArgs> IgnoreEpisode;

		event EventHandler<EpisodeDownloadEventArgs> DownloadEpisodes;

		event EventHandler<SearchEventArgs> SearchEpisodes;

		event EventHandler RefreshNavigationList;

		event EventHandler<FilePersistenceEventArgs> ImportPodcasts;
		event EventHandler<MultiFilePersistenceEventArgs> CopyFiles;
		event EventHandler<FilePersistenceEventArgs> CopyPlaylist;

		void RssRefreshStarting(int items);
		void RssRefreshProgress(int item);
		void RssRefreshFinished(int newItems);

		void ShowEpisodes(EpisodeCollection episodes);
		void RefreshEpisodes(EpisodeCollection episodes);
		void ShowEpisodeInfo(Episode episode);

		void EpisodeDownloadStarting(int items);
		void EpisodeDownloadProgress(int item);
		void EpisodeDownloadFinished(int items);

		void ReportError(string message);

		#region Device arrival/removal

		event EventHandler<PortableMediaSettingsEventArgs> PortableMediaSettingsChanged;

		event EventHandler<RemovableDriveEventArgs> RemovableDeviceArrived;
		event EventHandler<RemovableDriveEventArgs> RemovableDeviceRemoved;

		event EventHandler<TransferCommandEventArgs> TransferContent;
		event EventHandler RefreshPortableDevice;
		event EventHandler EjectDevice;

		void ShowDeviceStatus(PortableMediaViewModel vm);
		void RefreshDeviceStatus(PortableMediaViewModel vm);

		void TransferStarting(int items);
		void TransferProgress(int item);
		void TransferFinished(int items);

		void EnableTransfer(bool enable);

		#endregion Device arrival/removal

	}
}
